
/*
 *  Range.h
 *  SoundController0002
 *
 *  Created by jiro on 11/01/23.
 *  Copyright 2011 jiro music. All rights reserved.
 *
 */

#pragma once 

#include <sstream>

namespace sc {

	class Range {
	public:

		double start;

		double end;

	public:

		Range()
		 : start( - std::numeric_limits<double>::max() ),
		   end( std::numeric_limits<double>::max() )
		{}

		Range( double start, double end )
		 : start( start ),
		   end( end )
		{}

		bool operator == ( const Range& rhs ) const
		{
			if ( start == rhs.start && end == rhs.end ) {
				return true;
			}
			return false;
		}
		
		bool operator != ( const Range& rhs ) const
		{
			return not ( *this == rhs );
		}
		
		//	 for std::set
		bool operator < ( const Range& rhs ) const
		{
			if ( start != rhs.start ) {	
				return start < rhs.start;
			}
			if ( end != rhs.end ) {
				return end < rhs.end;
			}
			return false;
		}
		
		std::string ToString() const { 
			std::stringstream ss;
			ss << "start: " << start << ", end: " << end;
			return ss.str();
		}

	};

}
